package com.agriculture.monitor.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 *
 * </p>
 *
 * @author admin
 * @since 2021-07-15
 */
@Builder
@AllArgsConstructor
@NoArgsConstructor
@Data
@TableName("t_user")
public class User extends Model<User> {

    private static final long serialVersionUID = 1L;

    /**
     * 主键id
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 用户名
     */
    private String username;

    /**
     * 密码
     */
    private String password;

    /**
     * 手机号码
     */
    private String phone;

    /**
     * 父id
     */
    private Integer parentId;

    /**
     * 用户类型：root 顶级管理员
     */
    private Integer uType;

    /**
     * 备注
     */
    private String remarks;

    private LocalDateTime createTime;

    private LocalDateTime updateTime;

    /**
     * 状态：0-待审核，1-有效，2-禁用
     */
    private Integer status;

    @TableField(exist = false)
    private String token;





    public Integer getuType() {
        return uType;
    }

    public void setuType(Integer uType) {
        this.uType = uType;
    }

    @Override
    protected Serializable pkVal() {
        return this.id;
    }

}
